package com.grass.finding.model.domain;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 * 被寻找人的信息
 * @TableName lost
 */
@TableName(value ="lost")
@Data
public class Lost implements Serializable {
    /**
     * 主键
     */
    @TableId(value = "lostId", type = IdType.AUTO)
    private Integer lostId;

    /**
     * 发帖者openID
     */
    @TableField(value = "openId")
    private String openId;

    /**
     * 姓名
     */
    @TableField(value = "name")
    private String name;

    /**
     * 性别
     */
    @TableField(value = "gender")
    private String gender;

    /**
     * 籍贯
     */
    @TableField(value = "origin")
    private String origin;

    /**
     * 出生日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField(value = "birthday")
    private Date birthday;

    /**
     * 丢失日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField(value = "lostDate")
    private Date lostDate;

    /**
     * 丢失地址
     */
    @TableField(value = "lostAddress")
    private String lostAddress;

    /**
     * 相貌以及描述
     */
    @TableField(value = "description")
    private String description;

    /**
     * 联系电话
     */
    @TableField(value = "phone")
    private String phone;

    /**
     * 联系邮箱
     */
    @TableField(value = "email")
    private String email;

    /**
     * 备注或其他描述
     */
    @TableField(value = "other")
    private String other;

    /**
     * 是否删除
     */
    @TableLogic
    @TableField(value = "isDelete")
    private Integer isDelete;

    /**
     * 
     */
    @TableField(value = "creatTime")
    private Date creatTime;

    /**
     * 
     */
    @TableField(value = "updateTime")
    private Date updateTime;

    /**
     * 丢失人的图片地址
     */
    @TableField(value = "imageUrl")
    private String imageUrl;

    /**
     * 前端瀑布流展示的字段
     */
    @TableField(exist = false)
    private Integer index;

    /**
     * 连表用户的信息
     */
    @TableField(exist = false)
    private String userName;
    @TableField(exist = false)
    private String userAvatar;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Lost other = (Lost) that;
        return (this.getLostId() == null ? other.getLostId() == null : this.getLostId().equals(other.getLostId()))
            && (this.getOpenId() == null ? other.getOpenId() == null : this.getOpenId().equals(other.getOpenId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getGender() == null ? other.getGender() == null : this.getGender().equals(other.getGender()))
            && (this.getOrigin() == null ? other.getOrigin() == null : this.getOrigin().equals(other.getOrigin()))
            && (this.getBirthday() == null ? other.getBirthday() == null : this.getBirthday().equals(other.getBirthday()))
            && (this.getLostDate() == null ? other.getLostDate() == null : this.getLostDate().equals(other.getLostDate()))
            && (this.getLostAddress() == null ? other.getLostAddress() == null : this.getLostAddress().equals(other.getLostAddress()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
            && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
            && (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail()))
            && (this.getOther() == null ? other.getOther() == null : this.getOther().equals(other.getOther()))
            && (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()))
            && (this.getCreatTime() == null ? other.getCreatTime() == null : this.getCreatTime().equals(other.getCreatTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getImageUrl() == null ? other.getImageUrl() == null : this.getImageUrl().equals(other.getImageUrl()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getLostId() == null) ? 0 : getLostId().hashCode());
        result = prime * result + ((getOpenId() == null) ? 0 : getOpenId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getGender() == null) ? 0 : getGender().hashCode());
        result = prime * result + ((getOrigin() == null) ? 0 : getOrigin().hashCode());
        result = prime * result + ((getBirthday() == null) ? 0 : getBirthday().hashCode());
        result = prime * result + ((getLostDate() == null) ? 0 : getLostDate().hashCode());
        result = prime * result + ((getLostAddress() == null) ? 0 : getLostAddress().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
        result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode());
        result = prime * result + ((getOther() == null) ? 0 : getOther().hashCode());
        result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
        result = prime * result + ((getCreatTime() == null) ? 0 : getCreatTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getImageUrl() == null) ? 0 : getImageUrl().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", lostId=").append(lostId);
        sb.append(", openId=").append(openId);
        sb.append(", name=").append(name);
        sb.append(", gender=").append(gender);
        sb.append(", origin=").append(origin);
        sb.append(", birthday=").append(birthday);
        sb.append(", lostData=").append(lostDate);
        sb.append(", lostAddress=").append(lostAddress);
        sb.append(", description=").append(description);
        sb.append(", phone=").append(phone);
        sb.append(", email=").append(email);
        sb.append(", other=").append(other);
        sb.append(", isDelete=").append(isDelete);
        sb.append(", creatTime=").append(creatTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", imageUrl=").append(imageUrl);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}